import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        userInfo: {},
        orderList: {},
    },
    getters: {
        userInfo: (state) => {
            return state.userInfo;
        },
        orderList: (state) => {
            return state.orderList;
        },
    },
    mutations: {
        SET_USER_INFO(state, value) {
            state.userInfo = value;
        },
        SET_ORDER_LIST(state, value) {
            state.orderList[value.key] = value
        },
    },
    actions: {}
});
